#!/usr/bin/env/ python
# -*- coding: utf-8 -*-

"""
@author: super
@software: PyCharm
@file: auth
@time: 2022/1/27 11:36
"""

import os
from core.rest_client import RestClient
from commonon.read_data import ReadFileData

# 拿到封装的请求地址
BASE_PATH = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
data_file_path = os.path.join(BASE_PATH, "config", "setting.ini")
data = ReadFileData()
api_root_url = data.load_ini(data_file_path)["host"]["api_root_url"]


class Auth(RestClient):
    '''登录请求接口'''

    def __init__(self, api_root_url, **kwargs):
        super(Auth, self).__init__(api_root_url, **kwargs)

    def login_token(self, **kwargs):
        '''登录接口'''
        return self.post("/auth", **kwargs)


auth = Auth(api_root_url)